package com.ling.pl.security.view.frame.main;

import com.bstek.dorado.view.widget.Container;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * @author bo.wang
 * @since 2013-2-6
 */
@Component("ling2.frameTopListener")
public class FrameTopListener extends AbstractFrameListener {

    @Value("${ling2.mainFrameTopView.registerWidth:90}")
    private String width;

    public void onInit(Container container) {
        container.setWidth(width != null ? width : "90");
        for (IFrameShortcutActionRegister reg : registers) {
            if (!reg.isDisabled()) {
                reg.registerToFrameTop(container);
            }
        }
    }
}
